class Car:
    def __init__(self, license_plate: str, brand: str, color: str, price: float):
        self.license_plate = license_plate  # 车牌号
        self.brand = brand  # 品牌
        self.color = color  # 颜色
        self.price = price  # 价格
        self.fuel_level = 100  # 燃油量，假设初始为 100%
        self.is_running = False  # 是否在行驶中

    def __str__(self):
        return f"{self.color} {self.brand} (车牌号: {self.license_plate}, 价格: {self.price} 万元)"

    def drive(self, distance: float):
        """驾驶汽车"""
        if not self.is_running:
            if self.fuel_level > 0:
                self.is_running = True
                print(f"{self.brand} 正在行驶 {distance} 公里。")
                self.fuel_level -= distance * 0.1  # 假设每公里消耗 0.1% 燃油
                if self.fuel_level < 0:
                    self.fuel_level = 0
                    print("燃油耗尽，请加油！")
            else:
                print("燃油不足，无法驾驶！")
        else:
            print(f"{self.brand} 已经在行驶中。")

    def stop(self):
        """停车"""
        if self.is_running:
            self.is_running = False
            print(f"{self.brand} 已停车。")
        else:
            print(f"{self.brand} 已经处于停车状态。")

    def refuel(self):
        """加油"""
        if self.fuel_level < 100:
            self.fuel_level = 100
            print(f"{self.brand} 已加满油。")
        else:
            print(f"{self.brand} 油箱已满，无需加油。")


class ElectricCar(Car):
    def __init__(self, license_plate: str, brand: str, color: str, price: float, battery_capacity: float, range_per_charge: float):
        super().__init__(license_plate, brand, color, price)  # 调用父类的构造函数
        self.battery_capacity = battery_capacity  # 电池容量（单位：kWh）
        self.range_per_charge = range_per_charge  # 续航里程（单位：公里）
        self.current_range = range_per_charge  # 当前剩余续航里程

    def __str__(self):
        return (f"{self.color} {self.brand} (车牌号: {self.license_plate}, 价格: {self.price} 万元, "
                f"电池容量: {self.battery_capacity} kWh, 续航里程: {self.range_per_charge} 公里)")

    def charge(self):
        """充电"""
        if self.current_range < self.range_per_charge:
            self.current_range = self.range_per_charge
            print(f"{self.brand} 已充满电，续航里程恢复至 {self.range_per_charge} 公里。")
        else:
            print(f"{self.brand} 电量充足，无需充电。")

    def drive(self, distance: float):
        """驾驶电动汽车"""
        if not self.is_running:
            if self.current_range >= distance:
                self.is_running = True
                print(f"{self.brand} 正在行驶 {distance} 公里。")
                self.current_range -= distance
                if self.current_range < 0:
                    self.current_range = 0
                    print("电量耗尽，请充电！")
            else:
                print(f"电量不足，无法行驶 {distance} 公里。当前剩余续航里程为 {self.current_range} 公里。")
        else:
            print(f"{self.brand} 已经在行驶中。")